//
//  ViewController.m
//  ATGaode_demo
//
//  Created by Chengquan Ye on 2019/3/4.
//  Copyright © 2019年 Chengquan Ye. All rights reserved.
//

#import "ViewController.h"
#import "ATDemoViewController.h"
#import "ATDemoTwoViewController.h"
#import "ATDrawTrackViewController.h"

@interface ViewController () <UITableViewDataSource, UITableViewDelegate>

@property (weak, nonatomic) IBOutlet UITableView *tableView;

/** <#name#> */
@property (nonatomic, strong) NSArray *titles;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.rowHeight = 50;
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    
    self.titles = @[@"demoTwoVc", @"drawTrack封z", @"没用猎鹰"];
    
    [self.tableView reloadData];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.titles.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *ID = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:ID];
    }
    
    cell.textLabel.text = self.titles[indexPath.row];
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    if (indexPath.row == 0) {
        ATDemoTwoViewController *demoTwoVc = [[ATDemoTwoViewController alloc] init];
        [self.navigationController pushViewController:demoTwoVc animated:YES];
    } else if (indexPath.row == 1) {
        ATDrawTrackViewController *drawTrackVc = [[ATDrawTrackViewController alloc] init];
        [self.navigationController pushViewController:drawTrackVc animated:YES];
    } else if (indexPath.row == 2) {
        ATDemoViewController *demoVc = [[ATDemoViewController alloc] init];
        [self.navigationController pushViewController:demoVc animated:YES];
    }
}

- (IBAction)jump:(id)sender {
//    ATDemoViewController *demoVc = [[ATDemoViewController alloc] init];
//    demoVc.startDate = [NSDate date];
//    [self.navigationController pushViewController:demoVc animated:YES];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
   
}

@end
